<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:f="livcos.org/ns/xslt/function"
	exclude-result-prefixes="f">

	<xsl:import href="base.xsl" />
	
	<xsl:template match="/">
		<xsl:variable name="url" select="$testUrls[@id = 'url_3']"/>
		<xsl:variable name="userLogin" select="$testLogins[@id = 'login_2']"/>
		<xsl:variable name="login" select="'/localhost/data/test/logins#login_3'"/>
		<xsl:variable name="loginRequest">
			<http-request method="POST" response="non" login="{$login}">
				<param name="Bugzilla_login"><xsl:value-of select="$userLogin/@name"/></param>
				<param name="Bugzilla_password"><xsl:value-of select="$userLogin/@password"/></param>
			</http-request>
		</xsl:variable>
		<xsl:variable name="loginResponse"
			select="f:request(concat($url, '/index.cgi'), $loginRequest)"/>
		<test>
			<xsl:copy-of select="$loginResponse"/>
			<xsl:variable name="get">
				<http-request login="{$login}">
					<param name="columnlist">bug_id</param>
					<param name="order">bugs.bug_id</param>
					<param name="cmdtype">doit</param>
					<param name="ctype">rdf</param>
					<cookie name="Bugzilla_login">
						<xsl:value-of select="$loginResponse/cookie/Bugzilla_login"/>
					</cookie>
					<cookie name="Bugzilla_logincookie">
						<xsl:value-of select="$loginResponse/cookie/Bugzilla_logincookie"/>
					</cookie>
				</http-request>
			</xsl:variable>
			<xsl:copy-of select="$get"/>
			<xsl:copy-of select="f:request(concat($url, '/buglist.cgi'), $get)"/>
			<xsl:variable name="get1">
				<http-request login="{$login}">
					<param name="id">1</param>
					<param name="excludefield">attachmentdata</param>
					<param name="ctype">xml</param>
					<cookie name="Bugzilla_login">
						<xsl:value-of select="$loginResponse/cookie/Bugzilla_login"/>
					</cookie>
					<cookie name="Bugzilla_logincookie">
						<xsl:value-of select="$loginResponse/cookie/Bugzilla_logincookie"/>
					</cookie>
					<response charset="ISO-8859-1">
						<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
							<system systemId="{$url}/bugzilla.dtd"
								uri="-- empty --"/>
						</catalog>
					</response>
				</http-request>
			</xsl:variable>
			<xsl:sequence select="$get"/>
			<xsl:variable name="resp1" select="f:request(concat($url, '/show_bug.cgi'), $get1)"/>
			<xsl:sequence select="$resp1"/>
		</test>
	</xsl:template>
	
</xsl:stylesheet>